<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/******************************************************
* Profile			: article 
* Author			: 乔伟
* Create Time		: 2011-10-05 
* Modify Time		: 2011-10-05 
* Modify Profile	:  
******************************************************/
class page extends Front_Controller {
	
	/******************************************************
	* Profile			: 显示
	* Author			: 乔伟
	* Create Time		: 2011-10-05 
	* Modify Time		: 2011-10-05 
	* Modify Profile	:  
	******************************************************/
	public function show($id = null)
	{
		$id = empty($_GET['id'])?$id:$this->input->get('id');
		if($id!=null)
		{
			$page = $this->page_manager->get($id); 
		}  
		else
		{
			$page = $this->page_manager->get(array('alias'=>$this->input->get('alias'))); 
		}       
		//p_r($article);
		$tpl_show = "v_show";
		$part_template =  $page->part_template;
		if(!empty($part_template) &&
				file_exists(APPPATH."views/".$this->template."/".CONTROL_FOLDER."/page/v_".$part_template."_show.php"))
		{
			$tpl_show = "v_".$part_template."_show"; 
		}
		
		$this->load->view("front/page/$tpl_show",array('page'=>$page));   
		
		/*
		$id = $this->input->get('id');
		$article = $this->article_manager->get($id);
		$article->click();
		$tpl_show = "v_show";
		$part_template =  $article->class->part_template;
		if(!empty($part_template) &&
				file_exists(APPPATH."views/".$this->template."/".CONTROL_FOLDER."/article/v_".$part_template."_show.php"))
		{
			$tpl_show = "v_".$part_template."_show";
		}
		$this->load->view("front/article/$tpl_show",array('article'=>$article)); */  
	}
}
